package com.xinke.module.system.model.vo.oauth2;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

import javax.validation.constraints.*;

@Schema(description = "管理后台 - OAuth2 客户端新增/修改 Request VO")
@Data
public class OAuth2ClientSaveReqVO {

    @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "12030")
    private Long clientId;

    @Schema(description = "客户端编号", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "客户端编号不能为空")
    private String clientNo;

    @Schema(description = "客户端密钥", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "客户端密钥不能为空")
    private String clientSecret;

    @Schema(description = "应用名", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
    @NotEmpty(message = "应用名不能为空")
    private String clientName;

    @Schema(description = "应用图标", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "应用图标不能为空")
    private String clientLogo;

    @Schema(description = "应用描述")
    private String clientDesc;

    @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "状态不能为空")
    private Integer clientStatus;

    @Schema(description = "访问令牌的有效期", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "访问令牌的有效期不能为空")
    private Integer accessTokenValiditySeconds;

    @Schema(description = "刷新令牌的有效期", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "刷新令牌的有效期不能为空")
    private Integer refreshTokenValiditySeconds;

    @Schema(description = "可重定向的 URI 地址", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "可重定向的 URI 地址不能为空")
    private String redirectUri;

    @Schema(description = "授权类型", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "授权类型不能为空")
    private String authorizedGrantTypes;

    @Schema(description = "授权范围")
    private String authScope;

    @Schema(description = "自动通过的授权范围")
    private String autoApproveScopes;

    @Schema(description = "权限")
    private String authorities;

    @Schema(description = "资源")
    private String resourceIds;

    @Schema(description = "附加信息")
    private String additionalInformation;

}